---
title: "VIM Snippets"
date: 2019-6-18
categories:
- vim
tags:
---

<div id="content">
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orga1d532e">更改文件的缩进，从2空格转4空格</a></li>
<li><a href="#orgde6f256">CRLF 转换</a></li>
</ul>
</div>
</div>
<div class="outline-2" id="outline-container-orga1d532e">
<h2 id="orga1d532e">更改文件的缩进，从2空格转4空格</h2>
<div class="outline-text-2" id="text-orga1d532e">
<p>
首先将两个空格转为一个tab:
</p>
<pre class="example">
:set ts=2 sts=2 noet
:retab!
</pre>
<p>
然后将tab转成4个空格
</p>
<pre class="example">
:set ts=4 sts=4 et
:retab
</pre>
</div>
</div>
<div class="outline-2" id="outline-container-orgde6f256">
<h2 id="orgde6f256">CRLF 转换</h2>
<div class="outline-text-2" id="text-orgde6f256">
<p>
:set ff=unix
:set ff=dos
</p>
</div>
</div>
</div>
<div class="status" id="postamble">
<p class="date">Date: 2019-6-18</p>
<p class="author">Author: gdme1320</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
